<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML>
<html>
<head>
<title>My JSP 'result.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="assets/ico/biologo.ico" rel="shortcut icon">
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap-popover.js"></script>
<script type="text/javascript" src="js/bootstrap-scrollspy.js"></script>
<script type="text/javascript" src="js/bootstrap-tab.js"></script>

<style type="text/css">
body {
	background-image: url("");
	font-family: 方正静蕾简体;
}

#diseases {
	margin-top: 12px;
	margin-left: 20%;
	margin-right: 20%;
}

#container {
	display: none;
}

form {
	font-size: 16px;
}

#titlediv {
	margin-bottom: 0px;
}

.content {
	padding-left: 18px;
	background-color: #E8F5F7;
}

.add-on {
	font-size: 14px;
}

.form-actions {
	margin-right: 52%;
}

#diseases {
	
	position: absolute;
	top:0px;
	width: 700px;
	margin-top: -20px;
	margin-left: 360px;
}

.scrollspy-example {
	height: 200px;
	overflow: auto;
	position: relative;
}


.leftDiv {
	padding-left: 10px;
	margin-left: 0px;
	margin-top:12px;
	font-family: 方正静蕾简体;
	background-color: #FDFDFD;
	background-image: url("image/frenchstucco.png");
	border-radius: 0px 160px 6px 0px;
	width: 260px;
	height: auto;
}

.diseaseCategorySn {
	cursor: pointer;
}
.diseaseTypeSn {
	cursor: pointer;
}
img{
	margin-top: 30px;
}
</style>
</head>
<body>
	<%@ include file="include/topbar.jsp"%>
	<div class="leftDiv">
		<h2 style="padding-top:60px;">病例的分类</h2>
		<br> <span><a id="allfolds" href="javascript:void(0)"
			onclick="allFold()">－</a> 全部折叠</span> <br />
		<c:forEach var="diseaseCategory" items="${diseaseCategoryList }">

			<span class="diseaseCategorySn" id="stackFirst${diseaseCategory.sn}">
				＋<input type="hidden" name="diseaseCategorySnHidden"
				value="${diseaseCategory.sn }" /> </span>${diseaseCategory.name}
		<br />

			<div class="typeanddisease" id="stackTwo${diseaseCategory.sn}"
				style="display: none">

				<c:forEach var="diseaseType" items="${diseaseCategory.diseaseTypes}">
&nbsp;&nbsp;
				<%--第二层的东西------------------------- --%>
					<span class="diseaseTypeSn" id="stackSecound${diseaseType.sn}">
						＋<input type="hidden" name="diseaseTypeSnHidden"
						value="${diseaseType.sn}" /> </span>${diseaseType.name}
				<br />
					<div class="diseaseType" id="stackThree${diseaseType.sn}"
						style="display:none">
						<c:forEach var="disease" items="${diseaseType.diseases}">
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						<a href="searchResultPage.action?sn=${disease.sn }">${disease.name}</a>
							<br />
						</c:forEach>
						<br />
					</div>
				</c:forEach>
				<hr />
			</div>
		</c:forEach>

	</div>
	
	
	<div id="diseases">
	<hr />
		<img alt="" src="img/baolude-logo.gif">
		<hr />

		<s:iterator var="entryMap" value="#request.map" status="st0">
			<i class="icon-home"></i>
			<a href="togetHomePageOfDisease.action">查询主页</a>》》》
			<i class="icon-list-alt"></i>
			<s:property value="#entryMap.key.name" />
			<hr />
			<div id="collapse<s:property value='#entryMap.key.sn'/>"
				class="accordion-body collapse">
				<!-- --------------------------↓↓↓↓↓↓↓↓↓↓标签的存放-------------------------- -->
				<div class="tabbable" style="margin-bottom: 18px;">
					<ul class="nav nav-tabs">
						<li class="active"><a data-toggle="tab"
							href="#tab<s:property value='#entryMap.key.sn'/>a">基本信息： </a></li>
						<li class=""><a data-toggle="tab"
							href="#tab<s:property value='#entryMap.key.sn'/>b">疾病的测试： </a>
						</li>
						<li class=""><a data-toggle="tab"
							href="#tab<s:property value='#entryMap.key.sn'/>c">诊断： </a>
						</li>
						<li class=""><a data-toggle="tab"
							href="#tab<s:property value='#entryMap.key.sn'/>d">疾病的描述： </a>
						</li>
					</ul>
					<div class="tab-content active"
						style="padding-bottom: 9px; border-bottom: 1px solid #ddd;">
						<%--------------------------基本信息 --%>
						<div id="tab<s:property value='#entryMap.key.sn'/>a"
							class="tab-pane active">
							疾病名称：
							<s:property value="#entryMap.key.name" />
							<br /> 疾病的别名：
							<s:property value="#entryMap.key.alias" />
							<br /> 疾病的缩写：
							<s:property value="#entryMap.key.abbreviation" />
							<br /> 疾病的编号：
							<s:property value="#entryMap.key.code" />
							<br /> 疾病的编辑者：
							<s:property value="#entryMap.key.editor" />
							<br /> 疾病的发生率:
							<s:property value="#entryMap.key.incidence" />
							<br /> 疾病的相对性：
							<s:property value="#entryMap.key.relativity" />
							<br /> 疾病的平均值：
							<s:property value="#entryMap.key.avg1" />
							<br /> <i class="icon-edit"></i> <a
								href="editdisease.action?sn=<s:property value='#entryMap.key.sn'/>">编辑</a>
						</div>
						<%--------------测试 --%>
						<div id="tab<s:property value='#entryMap.key.sn'/>b"
							class="tab-pane">
							<!-- -------------------------------------------------------------这是test测试的一个标签----------------------------------------------- -->

							<div class="scrollspy-example" data-offset="0"
								data-target="#navbarExample" data-spy="scroll">
								<table
									class="table table-striped table-bordered table-condensed">
									<thead>
										<tr>
											<th width="15%">测试项目</th>
											<th width="35%">测试</th>
											<th width="20%">检测的大类型</th>
											<th width="15%">小类型</th>
											<th width="15%">测试名称</th>
										</tr>
									</thead>

									<tbody>
										<s:iterator var="entry0" value="#request.map" status="st0">
											<s:iterator var="entry1" value="#entry0.value" status="st1">
												<tr>
													<%--第一列的遍历 --%>
													<td
														rowspan="<s:property value='#request.maprows1[#entry0.key][key]'/>">
														<s:property value="key" />
													</td>
													<s:iterator var="entry2" value="value" status="st2">
														<s:if test="st2.index!=0">
															<tr>
														</s:if>
														<%-- 第二列的遍历--%>
														<td
															rowspan="<s:property value='#request.maprows2[#entry0.key][#entry1.key][key]'/>">
															<s:iterator value="#entry2.key" var="testO">
																<i class="icon-list-alt"></i>
																<s:property value="#testO.name" />
															</s:iterator></td>
														<s:iterator var="entry3" value="value" status="st3">
															<%--第三列的遍历 --%>
															<s:if test="st3.index!=0">
																<tr>
															</s:if>

															<td rowspan="<s:property value='value.size()'/>"><s:property
																	value="key" />
															</td>
															<s:iterator var="entry4" value="value" status="st4">
																<%--第四列的遍历 --%>
																<s:if test="st4.index!=0">
																	<tr>
																</s:if>
																<td><s:property value="testType" /></td>
																<%-- 第五列的遍历--%>
																<td><s:property value="name" /></td>
												</tr>
											</s:iterator>
										</s:iterator>
										</s:iterator>
										</s:iterator>
										</s:iterator>
									</tbody>
								</table>
							</div>

						</div>
						<%--------------诊断 --%>
						<div id="tab<s:property value='#entryMap.key.sn'/>c"
							class="tab-pane">
							疾病1的诊断<br />
							<s:iterator var="sampleInfo"
								value="<s:property value='#entryMap.key.sampleInfos'/>">
							</s:iterator>
							<!-- ----------------------------------------------------子标签---------------------------------------------------------------- -->
							<c:forEach var="sampleInfo" items="${testItem.sampleInfos}">
												病例测试的检验者：${sampleInfo.issue_time}<br />
												病例测试的sn的值：${sampleInfo.sn}<br />

							</c:forEach>
							<!-- -------------------------------------------------------新标签------------------------------------------------------- -->
						</div>
						<%------------------描述 --%>
						<div id="tab<s:property value="#entryMap.key.sn"/>d"
							class="tab-pane">
							${disease.name}:&nbsp;&nbsp;&nbsp;${disease.description }
							<%--该疾病对应的关键字名称：<br/>
							<c:forEach var="diseaseKeyword"
								items="${disease.diseaseKeywords}">
										${diseaseKeyword.name};&nbsp;&nbsp;&nbsp;&nbsp;
									</c:forEach>
						--%>
						</div>
					</div>
				</div>
			</div>
		</s:iterator>
		<!-- ----------------------------------------------------------------------------------------------------- -->



	</div>

	<div id="advancedDiseasesearch"></div>
	<hr />
	<hr />
</body>
<script type="text/javascript" charset="gbk">
	$('#myTab').tab('show');
	
	$(function() {
		$("#allfolds").click(function() {
			$(".typeanddisease").css("display", "none");
			$(".diseaseCategorySn").text("＋");
			$("#allfolds").text(" ＋ ");
		});
		$(".diseaseCategorySn").each(function() {
			var diseaseCategorySn = $(this).children().val();
			$("#stackFirst" + diseaseCategorySn).toggle(function() {
				$("#stackTwo" + diseaseCategorySn).css("display", "block");
				$("#stackFirst" + diseaseCategorySn).text("－");
			}, function() {
				$("#stackTwo" + diseaseCategorySn).css("display", "none");
				$("#stackFirst" + diseaseCategorySn).text("＋");
			});

		});

		$(".diseaseTypeSn").each(function() {
			var diseaseTypeSn = $(this).children().val();
			$("#stackSecound" + diseaseTypeSn).toggle(function() {
				$("#stackThree" + diseaseTypeSn).css("display", "block");
				$("#stackSecound" + diseaseTypeSn).text("－");
			}, function() {
				$("#stackThree" + diseaseTypeSn).css("display", "none");
				$("#stackSecound" + diseaseTypeSn).text("＋");
			});

		});
	});

	$(function() {
		$("#advancedSearch").click(function() {
			$("#diseases").hide();
			$.post("anvencedsearch.action");
		});
		$("#before").click(
				function() {
					var nowP = parseInt($("#nowpage").val());
					if (nowP == 0) {
						return false;
					}
					nowP = nowP - 1;
					if (nowP < 0) {
						nowP = 0;
					}
					window.location.href = "quickSearch.action?nowPage=" + nowP
							+ "&searchname=" + $("#hiddensearchname").val();
				});
		$("#next").click(
				function() {
					var nextP = parseInt($("#nowpage").val());
					if (nextP == $("#lastpage").attr("rel")) {
						return false;
					}
					var m = parseInt($("#lastpage").attr("rel"));
					nextP = nextP + 1;
					if (nextP > m) {
						nextP = m;
					}
					window.location.href = "quickSearch.action?nowPage="
							+ nextP + "&searchname="
							+ $("#hiddensearchname").val();
				});

		$(".pagenum").click(
				function() {
					var page = $(this).attr("rel");
					if (parseInt(page) == (parseInt($("#nowpage").val()) + 1)) {
						return false;
					}
					window.location.href = "quickSearch.action?nowPage="
							+ (parseInt(page) - 1) + "&searchname="
							+ $("#hiddensearchname").val();
				});

		$("#firstpage").click(
				function() {
					if (parseInt($("#nowpage").val()) == ($("#firstpage")
							.attr("rel"))) {
						return false;
					}
					window.location.href = "quickSearch.action?nowPage="
							+ $("#firstpage").attr("rel") + "&searchname="
							+ $("#hiddensearchname").val();
					$("#firstpage").parent().addClass("active");
				});
		$("#lastpage").click(
				function() {
					if (parseInt($("#nowpage").val()) == ($("#lastpage")
							.attr("rel"))) {
						return false;
					}
					$("#hiddensearchname").val();
					window.location.href = "quickSearch.action?nowPage="
							+ $("#lastpage").attr("rel") + "&searchname="
							+ $("#hiddensearchname").val();
				});
	});
	$(function() {
		$(".btn-danger").click(function() {
			$(".well").popover("show");
		});
		$(".disease_type").click(
				function() {
					$.post("disease_type.action", {
						"sn" : $(this).attr("rel")
					}, function(data) {
						$("#diseaseTypevalue" + data.diseaseCategory.sn)
								.toggle();
						$("#diseaseTypevalueSub" + data.diseaseCategory.sn)
								.text(data.diseaseCategory.name);
					});
				});
	});
	$(".collapse").collapse();
	$('#navbar').scrollspy();
	$('#myTab').tab('show');
</script>
</html>